﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using AMatysiak.Methods;

namespace AMatysiakTest.Methods
{
    [TestClass]
    public class WithoutSecondsTest
    {
        [TestMethod]
        public void compareNow()
        {
            DateTime dt = DateTime.Now;
            string withoutSeconds = "{Year}-{Month:00}-{Day:00} {Hour:00}:{Minute:00}".FormatNamed(dt);

            Assert.AreEqual(withoutSeconds, dt.WithoutSeconds());
        }

        [TestMethod]
        public void compareWithSec()
        {
            DateTime dt = DateTime.Now;
            string withSeconds = dt.ToString();

            Assert.AreNotEqual(withSeconds, dt.WithoutSeconds());
        }
    }
}
